<!--
 * @FileDescription: 校级管理员待办弹窗
 * @Author: 夏世龙
 * @Date: 2021-10-12
 * @LastEditors: 夏世龙
 * @LastEditTime: 2021-10-12 14:20
 -->
<template>
  <el-dialog
    :visible.sync="visible"
    width="50%"
    :before-close="handleClose">
    <h2 slot="title">院级待办事项</h2>
    <el-collapse  accordion>
      <el-collapse-item title="立项待审核批次" name="1">
         <el-table
           :header-cell-style="{background:'#eef1f6',color:'#606266','text-align':'center'}"
           :cell-style="{'text-align':'center'}"
           :data="$store.state.todoList.batchId"
           style="width: 100%;height: 300px;">
           <el-table-column
             prop="phaseName"
             label="阶段检查名称"
             >
           </el-table-column>
           <el-table-column
             prop="phaseTimeStart"
             label="开始时间"
             >
           </el-table-column>
           <el-table-column
             prop="phaseTimeStart"
             label="结束时间"
             >
           </el-table-column>
           <el-table-column
             label="操作">
             <template slot-scope="scope">
                   <el-button type="success" @click="auditBatchDep(scope.row.phaseId)">审核</el-button>
             </template>
           </el-table-column>
         </el-table>
      </el-collapse-item>
      <el-collapse-item title="阶段检查待审核" name="2">
        <el-table
          :header-cell-style="{background:'#eef1f6',color:'#606266','text-align':'center'}"
          :cell-style="{'text-align':'center'}"
          :data="$store.state.todoList.phaseId"
          style="width: 100%;height: 300px;">
          <el-table-column
            prop="phaseName"
            label="阶段检查名称"
            >
          </el-table-column>
          <el-table-column
            prop="phaseTimeStart"
            label="开始时间"
            >
          </el-table-column>
          <el-table-column
            prop="phaseTimeStart"
            label="结束时间"
            >
          </el-table-column>
          <el-table-column
            label="操作">
            <template slot-scope="scope">
                  <el-button type="success" @click="auditPhaseSchool(scope.row.phaseId)">审核</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-collapse-item>
      <el-collapse-item title="结项检查待审核" name="3">
          <el-table
            :header-cell-style="{background:'#eef1f6',color:'#606266','text-align':'center'}"
            :cell-style="{'text-align':'center'}"
            :data="$store.state.todoList.closeId"
            style="width: 100%;height: 300px;">
            <el-table-column
              prop="phaseName"
              label="阶段检查名称"
              >
            </el-table-column>
            <el-table-column
              prop="phaseTimeStart"
              label="开始时间"
              >
            </el-table-column>
            <el-table-column
              prop="phaseTimeStart"
              label="结束时间"
              >
            </el-table-column>
            <el-table-column
              label="操作">
              <template slot-scope="scope">
                    <el-button type="success" @click="auditPhaseSchool(scope.row.phaseId)">审核</el-button>
              </template>
            </el-table-column>
          </el-table>
      </el-collapse-item>
      <el-collapse-item title="延期检查待审核" name="4">
        <el-table
          :header-cell-style="{background:'#eef1f6',color:'#606266','text-align':'center'}"
          :cell-style="{'text-align':'center'}"
          :data="$store.state.todoList.needDealtPostProject"
          style="width: 100%;height: 300px;">
          <el-table-column
            prop="batchName"
            label="所在批次名称"
            >
          </el-table-column>
          <el-table-column
            prop="proName"
            label="项目名称"
            >
          </el-table-column>
          <el-table-column
            label="操作">
            <template slot-scope="scope">
                  <el-button type="success" @click="checkPostponeDep()">查看</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-collapse-item>
    </el-collapse>

    <span slot="footer" class="dialog-footer">
      <el-button @click="cancelModal">取 消</el-button>
      <el-button type="primary" @click="handleClose">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
    export default {
      props:{
        visible: {
          type: Boolean,
          default: false
        }
      },
      created() {
        this.refreshData()
      },
      data() {
        return {
          testData:[]
        };
      },
      methods: {
        refreshData(){
          this.$store.commit('getTodoList')
        }
        ,
        cancelModal(){
          this.$emit('update:visible', false);
          this.refreshData()
        },
        auditBatchDep(batchId){
          this.cancelModal()
          this.$router.push({path:'/depProjectAudit',query:{batch_id:batchId}})
        },
        auditPhaseSchool(phaseId){
          this.cancelModal()
          this.$router.push({path:'/phaseSchAudit',query:{phaseId:phaseId}})
        },
        //延期审核
        checkPostponeDep(){
          this.$router.push({path:'/delaySchAudit'})
        },
        handleClose(done) {
          this.$confirm('确认关闭？')
            .then(_ => {
             this.$emit('update:visible', false);
            })
            .catch(_ => {});
        }
      }
    };
</script>

<style scoped>

</style>
